package com.zhhh.domain;
// Generated 2019-11-12 8:39:39 by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * BRoleModeEm generated by hbm2java
 */
@Entity
@Table(name = "b_role_mode_em")
public class BRoleModeEm implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String roleCode;
	private String modeCode;
	private String ctrlId;
	private String emId;
	private Integer ifEnable;
	private Integer ifVisible;
	
	private BRole role = new BRole();

	public BRoleModeEm() {
	}

	public BRoleModeEm(String roleCode, String modeCode, String ctrlId, String emId, Integer ifEnable,
			Integer ifVisible) {
		this.roleCode = roleCode;
		this.modeCode = modeCode;
		this.ctrlId = ctrlId;
		this.emId = emId;
		this.ifEnable = ifEnable;
		this.ifVisible = ifVisible;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "role_code", length = 40)
	public String getRoleCode() {
		return this.roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	@Column(name = "mode_code", length = 40)
	public String getModeCode() {
		return this.modeCode;
	}

	public void setModeCode(String modeCode) {
		this.modeCode = modeCode;
	}

	@Column(name = "ctrl_id", length = 40)
	public String getCtrlId() {
		return this.ctrlId;
	}

	public void setCtrlId(String ctrlId) {
		this.ctrlId = ctrlId;
	}

	@Column(name = "em_id", length = 40)
	public String getEmId() {
		return this.emId;
	}

	public void setEmId(String emId) {
		this.emId = emId;
	}

	@Column(name = "if_enable")
	public Integer getIfEnable() {
		return this.ifEnable;
	}

	public void setIfEnable(Integer ifEnable) {
		this.ifEnable = ifEnable;
	}

	@Column(name = "if_visible")
	public Integer getIfVisible() {
		return this.ifVisible;
	}

	public void setIfVisible(Integer ifVisible) {
		this.ifVisible = ifVisible;
	}

	@ManyToOne(cascade = CascadeType.ALL)
	/**
	 * name  指本表字段名称   referencedColumnName  指关联表字段名称
	 */
	@org.hibernate.annotations.ForeignKey(name="none")
	@JoinColumn(name="role_code", referencedColumnName="role_code",insertable=false,updatable=false)
	@JsonIgnore
	public BRole getRole() {
		return role;
	}

	public void setRole(BRole role) {
		this.role = role;
	}

}
